package cn.silver.module.quartz.runner;

import cn.silver.module.quartz.enums.QuartzStatusEnums;
import cn.silver.module.quartz.enums.QuartzStrategyEnums;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import static cn.silver.framework.core.constant.CacheConstants.MODEL_MAP;

/**
 * @author zhouxiaobo
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class QuartzRunner implements ApplicationRunner {

    @Override
    public void run(ApplicationArguments args) {
        MODEL_MAP.put("system-quartz-status", QuartzStatusEnums.getModels());
        MODEL_MAP.put("system-quartz-strategy", QuartzStrategyEnums.getModels());
    }
}
